# @Author   : 懒羊羊
# @File     : mym2.py
# @Time     : 2024/11/28 18:13
import json
import os
from config.config import pro_path
from mym1 import MyClass

cj1 = [50, 90, 89, 70, 89, 78]
cj2 = [40, 90, 100, 70, 69, 77]


if __name__ == '__main__':
    # 将data.json写入datas 目录下
    file_path = pro_path + '\datas\data.json'

    # 写入文件，file_path文件地址，w 写入
    # with open(file_path, 'w', encoding='utf-8') as file1:
    #     json.dump(cj1, file1, ensure_ascii=False)

    # 读取文件内容，r 读取
    with open(file_path, 'r', encoding='utf-8') as file2:
        data_from_json = json.load(file2)

    print(f"读取内容：{data_from_json}")

    myclass1 = MyClass("班级1", 6, "开发", cj1)
    myclass2 = MyClass("班级2", 6, "rc", cj2)
    num1 = myclass1.get_High_Score()
    num2 = myclass2.get_High_Score()
    if num1 > num2:
        a = num1 + num2
        print(f"最高分相加，结果是：{a}")
    else:
        b = num1 - num2
        print(f"最高分相减，结果是：{b}")

    myclass1.find(100)
    myclass2.find(100)

